<!-- 成控部：工厂生产作业-指令资料审核 蹇泽阳 -->
<template>
  <div class="app-container">
    <Find :OriginalFilter="{ static: true }" :formList="formList" @findClicked="findClicked" @clickInput="clickInput" />
    <div class="mt10 flex" style="width: 100%; background-color: white">
      <el-card shadow="never" :body-style="{ padding: '10px 0px 0px 5px' }">
        <div class="flex AIC">
          <h1 class="f16">指令明细</h1>
          <el-button
            class="primaryBth ml10"
            type="primary"
            size="default"
            @click="
              () => {
                drawer = true
                value = 0
                getTableList999(0)
              }
            "
            >PO号码明细</el-button
          >
          <el-button
            class="primaryBth"
            type="primary"
            size="default"
            @click="
              () => {
                drawer = true
                value = 1
                getTableList999(1)
              }
            "
            >指令用量明细</el-button
          >
          <el-button
            class="primaryBth"
            type="primary"
            size="default"
            @click="
              () => {
                drawer = true
                value = 2
                getTableList999(2)
              }
            "
            >配色注意事项</el-button
          >
          <el-button
            class="primaryBth"
            type="primary"
            size="default"
            @click="
              () => {
                drawer = true
                value = 3
                getTableList999(3)
              }
            "
            >型体配宣明细</el-button
          >
          <el-button
            class="primaryBth"
            type="primary"
            size="default"
            @click="
              () => {
                drawer = true
                value = 4
                getTableList999(4)
              }
            "
            >配色BOM资料</el-button
          >
          <el-button
            class="primaryBth"
            type="primary"
            size="default"
            @click="
              () => {
                drawer = true
                value = 5
                getTableList999(5)
              }
            "
            >各节点生产明细</el-button
          >
        </div>
        <Table
          :tableData="tableData"
          :tableHeader="tableHeader"
          :selection="true"
          :summaryData="summaryData"
          summary
          @currentRow="currentRow"
          :isLoading="isLoading"
          :getTableList="getTableList"
          @confirmChange="confirmChange"
          @selectList="selectTableList"
        />
        <Find :OriginalFilter="{ static: true }" :formList="formList2" :searchImg="false" @findClicked="findClicked2"> </Find>
      </el-card>
      <el-card shadow="never" :body-style="{ padding: '10px 5px 0px' }" style="width: 180px">
        <div slot="header" class="f16">
          <span style="font-weight: 600">指令明细</span>
        </div>
        <Table
          :tableHeader="tableHeader2"
          :tableData="tableData2"
          :summaryData="summaryData2"
          summary
          :getTableList="getTableList2"
          @confirmChange="confirmChange2"
        />
      </el-card>
    </div>
    <el-card shadow="never" :body-style="{ padding: '5px' }">
      <PageModule :PageData="{ total, buttonS: true }" @pageSizeChange="handleSizeChange" @pageChange="handleCurrentChange" />
    </el-card>

    <!-- 抽屉 -->
    <el-drawer v-model="drawer" :direction="'ttb'" size="small" :with-header="false">
      <span @click="drawer = false" style="float: right; cursor: pointer; color: rgb(7, 7, 7)">X</span>
      <div class="flex AIC" style="flex-direction: column">
        <el-card shadow="always" :body-style="{ padding: '10px 10px 10px' }" style="width: 100vw">
          <div class="flex AIC">
            <el-select style="width: 200px" v-model="value" filterable placeholder="PO号码明细" @change="(val: any) => EndSelectVal(val)">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
            </el-select>

            <div v-if="value === 0" class="flex ml20 AIC">
              <el-select
                style="width: 150px"
                v-model="value2"
                clearable
                filterable
                placeholder="美码/英码"
                @change="(val: any) => getPoNumberSizeData()"
                :disabled="disabledValue2"
              >
                <el-option v-for="item in options2" :key="item.value" :label="item.label" :value="`${item.value}  ${item.label}`"> </el-option>
              </el-select>
              <!-- <JDialog :tableHeader="JDialogHeader" :width="60" @confirm="dialogConfirm" @removeOne="removeOne" @clickAdd="clickAdd"></JDialog> -->
            </div>

            <div v-if="value === 5" class="ml10 flexSB mr45" style="flex: 1">
              <el-button class="primaryBth" type="primary" size="default" @click="getSoleDetailsAdd">取大底入货号码明细</el-button>
              <el-button class="primaryBth" type="primary" size="default" @click="getStitchDetailsAdd">取鞋面生产号码明细</el-button>
              <el-button class="primaryBth" type="primary" size="default" @click="getLastDetailsAdd">取成型生产号码明细</el-button>
            </div>
          </div>

          <!-- PO号码明细 -->
          <div class="mt15" v-if="value === 0">
            <Table
              :showToolTip="false"
              :tableHeader="tableHeader4"
              :tableData="tableData4"
              :TableHeight="30"
              :outTableHeight="160"
              :summaryData="summaryData6"
              summary
              @currentRow="currentRow4"
            />
          </div>
          <!-- 指令用量明细 -->
          <div class="mt15" v-if="value === 1">
            <Table @confirmChange="confirmChange5" :tableHeader="tableHeader5" :tableData="tableData5" :TableHeight="30" :outTableHeight="160" />
          </div>
          <!-- 配色注意事项 -->
          <div class="mt15" v-if="value === 2">
            <Table :tableHeader="tableHeader6" :tableData="tableData6" :TableHeight="30" :outTableHeight="140" />
          </div>
          <!-- 型体配宣明细 -->
          <div class="mt15" v-if="value === 3">
            <Table :tableHeader="tableHeader7" :tableData="tableData7" :TableHeight="30" :outTableHeight="160" />
          </div>
          <!-- 配色BOM资料 -->
          <div class="mt15" v-if="value === 4">
            <Table :tableHeader="tableHeader8" :tableData="tableData8" :TableHeight="30" :outTableHeight="160" />
          </div>
          <!-- 各节点生产明细 -->
          <div class="mt15 flexSB" v-if="value === 5" style="margin-left: 180px">
            <Table
              :summaryData="summaryData3"
              summary
              :tableHeader="tableHeader9"
              :tableData="tableData9"
              class="mr55"
              :TableHeight="30"
              :outTableHeight="160"
            />
            <Table
              :summaryData="summaryData4"
              summary
              :tableHeader="tableHeader10"
              :tableData="tableData10"
              class="mr55"
              :TableHeight="30"
              :outTableHeight="160"
            />
            <Table
              :summaryData="summaryData5"
              summary
              :tableHeader="tableHeader11"
              :tableData="tableData11"
              :TableHeight="30"
              :outTableHeight="160"
            />
          </div>
          <PageModule :PageData="{ total }" @pageSizeChange="handleSizeChange" @pageChange="handleCurrentChange" />
        </el-card>
      </div>
    </el-drawer>

    <!-- 指令复制 -->
    <el-dialog v-model="lotNoVisible" title="取消审核指令资料" width="18%">
      <el-form label-width="100px">
        <el-form-item label="取消审核日期">
          <el-date-picker :placeholder="formatCurrentDate(currentDate)" type="date" format="YYYY/MM/DD" value-format="YYYY-MM-DD" disabled />
        </el-form-item>
        <el-form-item label="取消审核原因">
          <el-input v-model="cancelReason"></el-input>
        </el-form-item>
        <el-form-item label="提前批指令">
          <el-checkbox v-model="beforeLotNo" @change=""></el-checkbox>
        </el-form-item>
      </el-form>
      <el-button type="primary" class="primaryBth" @click="cancelHandle" style="float: right">确定</el-button>
      <el-button type="primary" class="primaryBth mr15" @click="lotNoVisible = false" style="float: right">返回</el-button>
    </el-dialog>
  </div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import 'dayjs/locale/zh-cn'
import { ElMessage, ElMessageBox } from 'element-plus'
import Synchronization from '@/utils/Synchronization'
import SynchronizationLoginWork from '@/utils/SynchronizationLoginWork'
import { formateData } from '@/plugins/mixinJ'
import router from '@/router'
import { debounce } from 'lodash'
import JMessage from '@/utils/JMessage'
export default defineComponent({
  name: 'InstructionDataReviewQl'
})
</script>
<script lang="ts" setup>
import { i18n, Jzhcn } from '@/i18n'
import { onMounted, reactive, ref, watch } from 'vue'
const currentLotNo = ref('')
const copyLotNo = ref('')
const lotNoVisible = ref(false)
const mark = ref('')
const value2 = ref('')
const drawer = ref(false)

// Dialog模块
const dialogStyle = ref('')
const dialogColorCode = ref('')
const dialogColorName = ref('')
const tableHeader12 = ref([
  {
    label: '工厂型体',
    prop: 'styleNo'
  },
  {
    label: '颜色代码',
    prop: 'colorCode'
  },
  {
    label: '颜色名称',
    prop: 'styleColor'
  }
])
const tableData12 = ref([]) as any
const isLoading12 = ref(false)
const copyOptions = ref([])
const getTableList12 = async () => {
  isLoading12.value = true
  let { styleToDetail } = await Synchronization.get<any, any>('/style/getCondition')
  tableData12.value = styleToDetail
  copyOptions.value = styleToDetail
  isLoading12.value = false
}
const dialog = ref(false)
const clickInput = (item: any) => {
  if (item.inputPlaceholder === '工厂型体 颜色代码 颜色名称') {
    tableData12.value = []
    dialogStyle.value = ''
    dialogColorCode.value = ''
    dialogColorName.value = ''
    dialog.value = true
    getTableList12()
  }
}

watch([dialogStyle, dialogColorCode, dialogColorName], (val) => {
  if (val[0] === '' && val[1] === '' && val[2] === '') {
    tableData12.value = copyOptions.value
  }
})

// 日期
const currentDate = new Date()
const formatCurrentDate = (date?: any) => {
  const year = date.getFullYear()
  const month = date.getMonth() + 1
  const day = date.getDate()
  return `${year}-${month}-${day}`
}

const cancelReason = ref('')
const beforeLotNo = ref(false)
// 表一模块
const formList = ref<any>([
  {
    type: 'input',
    inputPlaceholder: '请输入指令',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入工厂型体',
    inputValue: ''
  },
  {
    type: 'selectJ',
    selectP: '颜色名称  颜色代码',
    selectValue: '',
    selectOptions: []
  },
  {
    type: 'select',
    selectValue: '',
    selectLabel: '',
    selectP: '新旧型体',
    selectOptions: [
      {
        optionValue: '新款',
        optionLabel: '新款'
      },
      {
        optionValue: '旧款',
        optionLabel: '旧款'
      }
    ]
  },
  {
    type: 'input',
    inputPlaceholder: '请输入合同号',
    inputValue: ''
  },

  {
    type: 'date',
    dateLabel: '下单日期',
    dateValue: ''
  },
  {
    type: 'date',
    dateLabel: '客人交期',
    dateValue: ''
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '品牌',
    selectLabel: '',
    selectOptions: []
  },
  {
    type: 'input',
    inputPlaceholder: '请输入客人货号',
    inputValue: ''
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '冲刀',
    selectLabel: '',
    selectOptions: []
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '楦头',
    selectLabel: '',
    selectOptions: []
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '底模',
    selectLabel: '',
    selectOptions: []
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '大底厂商',
    selectLabel: '',
    selectOptions: []
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '季度',
    selectLabel: '',
    selectOptions: []
  },
  {
    type: 'button',
    checkboxLabel: '置空',
    bgColor: '#1890FF'
  },
  {
    type: 'date',
    dateLabel: '审核日期',
    dateValue: ''
  },
  {
    type: 'button',
    checkboxLabel: '审核'
  },
  {
    type: 'button',
    checkboxLabel: '取消审核'
  }
])
const findClicked = async (content: string) => {
  console.log(content)
  if (content === '置空') {
    formList.value.forEach((item: any) => {
      item.inputValue = ''
      item.selectValue = ''
      item.dateValue = ''
    })
    getTableList()
  }
  if (content === '审核') {
    const res = (await SynchronizationLoginWork.post(
      `/style/getLotNoCheckUp/${0}`,
      selectedLists.value.map((item: any) => {
        return {
          lotNo: item.lotNo
        }
      })
    )) as any
    if (res.code === 200) {
      JMessage.success('审核成功')
      getTableList()
    } else {
      JMessage.error(res.message)
    }
  }
  if (content === '取消审核') {
    if (currentTableRow.value.checkFlag === 'Y') {
      cancelReason.value = ''
      beforeLotNo.value = false
      lotNoVisible.value = true
    } else {
      JMessage.error('该指令未审核')
    }
  }
}
// 取消审核确定按钮
const cancelHandle = async () => {
  const res = (await SynchronizationLoginWork.post(
    `/style/getLotNoCheckUp/${1}`,
    selectedLists.value.map((item: any) => {
      return {
        lotNo: item.lotNo,
        flag: beforeLotNo.value === true ? 'Y' : 'N',
        reason: cancelReason.value
      }
    })
  )) as any
  if (res.code === 200) {
    JMessage.success('取消审核成功')
    getTableList()
  } else {
    JMessage.error(res.message)
  }
  lotNoVisible.value = false
}
// 复制Dialog点击确认按钮
const ClickCopyLotNo = async () => {
  const res = (await SynchronizationLoginWork.post(`/style/getLotNoCopy`, {
    lotNo: currentTableRow.value.lotNo,
    newLotNo: copyLotNo.value
  })) as any
  if (res.code === 200) {
    JMessage.success('指令复制成功')
    getTableList()
    lotNoVisible.value = false
  } else {
    JMessage.error(res.message)
  }
}
const tableData = ref<any>([])
const imgList = ref([])
const tableHeader = ref([
  {
    type: 'img',
    label: '图片',
    fixed: true,
    prop: 'photoPath',
    srcList: imgList,
    width: 50
  },
  {
    backgroundColor: true,
    label: '指令',
    prop: 'lotNo',
    width: 80,
    change: true
  },
  {
    label: '工厂型体',
    prop: 'style',
    width: 100
  },
  {
    label: '新旧型体',
    prop: 'styleType',
    width: 60
  },
  {
    label: '颜色代码',
    prop: 'colorCode',
    width: 100
  },
  {
    label: '颜色',
    prop: 'color',
    width: 100
  },
  {
    label: '合同号',
    prop: 'customPo',
    width: 90
  },
  {
    label: '下单日期',
    prop: 'orderDate',
    width: 110
  },
  {
    label: '客人交期',
    prop: 'deliveryDate',
    width: 110
  },
  {
    label: '品牌',
    prop: 'custom',
    width: 65
  },
  {
    label: '季度',
    prop: 'season',
    width: 90
  },
  {
    label: '客人货号',
    prop: 'developmentNo',
    width: 90
  },
  {
    label: '冲刀',
    prop: 'cutNo',
    width: 90
  },
  {
    label: '底模',
    prop: 'moldNo',
    width: 90
  },
  {
    label: '楦头',
    prop: 'lastNo',
    width: 90
  },
  {
    label: '大底厂商',
    prop: 'soleVendor',
    width: 90
  },
  {
    label: '订单数',
    prop: 'orderQty',
    width: 50
  },
  {
    label: '预补数',
    prop: 'surplusQty',
    width: 50
  },
  {
    label: '基本码',
    prop: 'baseSize',
    width: 50
  },
  {
    label: '中间码',
    prop: 'mSize',
    width: 50
  },
  {
    label: '检核状态',
    prop: 'cfmFlag',
    width: 50,
    change: true
  },
  {
    label: '生成状态',
    prop: 'generateFlag',
    width: 50,
    change: true
  },{
    label: '备注',
    prop: 'remark',
    width: 50,
    change: true
  }
])
const formList2 = ref([
  {
    disabled: true,
    type: 'checkbox',
    checkboxLabel: '全套',
    checked: false
  },
  {
    disabled: true,
    type: 'checkbox',
    checkboxLabel: '主面料',
    checked: false
  },
  {
    disabled: true,
    type: 'checkbox',
    checkboxLabel: '冲裁',
    checked: false
  },
  {
    disabled: true,
    type: 'checkbox',
    checkboxLabel: '工艺',
    checked: false
  },
  {
    disabled: true,
    type: 'checkbox',
    checkboxLabel: '配套',
    checked: false
  },
  {
    disabled: true,
    type: 'checkbox',
    checkboxLabel: '针车',
    checked: false
  },
  {
    disabled: true,
    type: 'checkbox',
    checkboxLabel: '大底',
    checked: false
  },
  {
    disabled: true,
    type: 'checkbox',
    checkboxLabel: '成型',
    checked: false
  },
  {
    disabled: true,
    type: 'checkbox',
    checkboxLabel: '外发',
    checked: false
  },
  {
    type: 'input',
    inputPlaceholder: '',
    inputValue: '',
    inputLabel: '制单人',
    inputDisabled: true
  },
  {
    type: 'input',
    inputPlaceholder: '',
    inputValue: '',
    inputLabel: '制单日期',
    inputDisabled: true
  },
  {
    type: 'input',
    inputPlaceholder: '',
    inputValue: '',
    inputLabel: '检核日期',
    inputDisabled: true
  },
  {
    type: 'input',
    inputPlaceholder: '',
    inputValue: '',
    inputLabel: '指令生成日期',
    inputDisabled: true
  },
  {
    type: 'input',
    inputPlaceholder: '',
    inputValue: '',
    inputLabel: '备注',
    inputDisabled: true
  }
])
// 总计
interface summaryDataType {
  index: number
  num: number | undefined
}
const summaryData = ref<summaryDataType[]>([
  {
    index: 17,
    num: 0
  },
  {
    index: 18,
    num: 0
  }
])
// 分页器
const currentPage = ref(1)
const pageSize = ref(20)
const total = ref(0)
const handleSizeChange = (val: number) => {
  pageSize.value = val
  getTableList()
}
const handleCurrentChange = (val: number) => {
  currentPage.value = val
  getTableList()
}
const isLoading = ref(true)
// 获取表数据
const getTableList = debounce(async (status: any = null) => {
  isLoading.value = true
  let tableDataList = await Synchronization.post<any, any>('/style/getStyleData', {
    lotNo: formList.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入指令'
    )?.inputValue, //	指令
    style: formList.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入工厂型体'
    )?.inputValue, //	型体
    color: formList.value
      .find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '颜色名称  颜色代码')
      ?.selectValue.split('  ')[0], //	颜色名称
    colorCode: formList.value
      .find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '颜色名称  颜色代码')
      ?.selectValue.split('  ')[1], //	颜色代码
    custom: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '品牌')
      ?.selectValue, //	品牌
    customPo: formList.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入合同号'
    )?.inputValue, //	合同号
    cutNo: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '冲刀')
      ?.selectValue, //	冲刀
    deliveryEndDate:
      formList.value.find((item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '客人交期')
        ?.dateValue?.[1] === undefined
        ? ''
        : formList.value.find((item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '客人交期')
            ?.dateValue?.[1] + ' 00:00:00', //	交期日期结束
    deliveryStartDate:
      formList.value.find((item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '客人交期')
        ?.dateValue?.[0] === undefined
        ? ''
        : formList.value.find((item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '客人交期')
            ?.dateValue?.[0] + ' 00:00:00', //	交期日期开始
    developmentNo: formList.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入客人货号'
    )?.inputValue, //	客人货号
    lastNo: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '楦头')
      ?.selectValue, //	楦头
    moldNo: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '底模')
      ?.selectValue, //	底模
    orderEndDate:
      formList.value.find((item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '下单日期')
        ?.dateValue?.[1] === undefined
        ? ''
        : formList.value.find((item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '下单日期')
            ?.dateValue?.[1] + ' 00:00:00', //	下单日期结束
    orderStartDate:
      formList.value.find((item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '下单日期')
        ?.dateValue?.[0] === undefined
        ? ''
        : formList.value.find((item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '下单日期')
            ?.dateValue?.[0] + ' 00:00:00', //	下单日期开始
    pageNum: currentPage.value, //		intege
    pageSize: pageSize.value, //		intege
    season: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '季度')
      ?.selectValue, //	季度
    soleVendor: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '大底厂商')
      ?.selectValue, //	大底厂商
    styleType: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '新旧型体')
      ?.selectValue, //	新旧型体
    status //	状态
  })
  isLoading.value = false
  imgList.value = tableDataList.styleDetails.map((item: any) => {
    return item.photoPath
  })
  tableData.value = tableDataList.styleDetails.map((item: any) => {
    if (item.checkFlag === 'Y') item.backgroundColor = '#1CD66C'
    return item
  })
  total.value = tableDataList.total
  currentRow()
  if (tableDataList.orderCount !== null) {
    summaryData.value[0].num = tableDataList.orderCount.orderCount
    summaryData.value[1].num = tableDataList.orderCount.surplusCount
  }
}, 500)
watch(
  formList.value[1],
  debounce(async () => {
    formList.value
      .find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '颜色名称  颜色代码')
      .selectOptions.splice(0)
    const res = (await Synchronization.post('/Cargo/getDevelopBomPhotoList', {
      colorCode: '',
      companyId: '',
      pageNum: '',
      pageSize: '',
      styleColor: '',
      styleNo: formList.value.find(
        (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入工厂型体'
      )?.inputValue
    })) as any
    res.list.forEach((item: any) => {
      formList.value
        .find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '颜色名称  颜色代码')
        .selectOptions.push({
          value: `${item.styleColor}  ${item.colorCode}`,
          label: `${item.styleColor}  ${item.colorCode}`
        })
    })
  }, 500)
)
watch(
  () =>
    formList.value.map((item: any) => {
      item.selectValue, item.inputValue, item.dateValue, item.checked
    }),
  () => {
    getTableList()
  }
)
// 修改指令明细表格
const getFormateTable = (row: any = tableData.value[0]) => {
  const obj = {
    ...row,
    deliveryDate: row.deliveryDate + ' 00:00:00',
    orderDate: row.orderDate + ' 00:00:00'
  }
  const table = formateData([obj])
  return table
}
const confirmChange = async (row: any, fn: any, current: any) => {
  const table = getFormateTable(row)
  const res = (await SynchronizationLoginWork.put('/style/getStyleDetailUpdate', table[0])) as any
  if (res.code === 200) {
    JMessage.success('修改成功')
  } else {
    JMessage.error(res.message)
  }
  getTableList()
}
const selectedLists = ref([]) as any
const selectTableList = (selectedList: any) => {
  selectedLists.value = selectedList
}
// 点击当前行
const currentTableRow = ref(tableData.value[0]) as any
const currentRow = async (row: any = tableData.value[0] ? tableData.value[0] : {}) => {
  row.processAll === 'Y' ? (formList2.value[0].checked = true) : (formList2.value[0].checked = false)
  row.processUpper === 'Y' ? (formList2.value[1].checked = true) : (formList2.value[1].checked = false)
  row.processCut01 === 'Y' ? (formList2.value[2].checked = true) : (formList2.value[2].checked = false)
  row.processCut02 === 'Y' ? (formList2.value[3].checked = true) : (formList2.value[3].checked = false)
  row.processCut03 === 'Y' ? (formList2.value[4].checked = true) : (formList2.value[4].checked = false)
  row.processStitch === 'Y' ? (formList2.value[5].checked = true) : (formList2.value[5].checked = false)
  row.processSole === 'Y' ? (formList2.value[6].checked = true) : (formList2.value[6].checked = false)
  row.processLast === 'Y' ? (formList2.value[7].checked = true) : (formList2.value[7].checked = false)
  row.outFlag === 'Y' ? (formList2.value[8].checked = true) : (formList2.value[8].checked = false)
  formList2.value[9].inputValue = row.userId
  formList2.value[10].inputValue = row.sysDate
  formList2.value[11].inputValue = row.cfmDate
  formList2.value[12].inputValue = row.generateDate
  formList2.value[13].inputValue = row.lotRemark

  // 指令明细
  await getTableList2(row.lotNo)
  currentTableRow.value = row
  currentLotNo.value = row.lotNo || ''
  getTableList999(value.value)
  getPoNumberSizeData()
}
// 修改指令明细下的单选
const findClicked2 = (content: any) => {
  ElMessageBox.confirm('是否修改？', {
    confirmButtonText: '确认',
    cancelButtonText: '取消',
    type: 'warning'
  })
    .then(async () => {
      const table = getFormateTable(currentTableRow.value)
      formList2.value[0].checked === true ? (table[0].processAll = 'Y') : (table[0].processAll = '')
      formList2.value[1].checked === true ? (table[0].processUpper = 'Y') : (table[0].processUpper = '')
      formList2.value[2].checked === true ? (table[0].processCut01 = 'Y') : (table[0].processCut01 = '')
      formList2.value[3].checked === true ? (table[0].processCut02 = 'Y') : (table[0].processCut02 = '')
      formList2.value[4].checked === true ? (table[0].processCut03 = 'Y') : (table[0].processCut03 = '')
      formList2.value[5].checked === true ? (table[0].processStitch = 'Y') : (table[0].processStitch = '')
      formList2.value[6].checked === true ? (table[0].processSole = 'Y') : (table[0].processSole = '')
      formList2.value[7].checked === true ? (table[0].processLast = 'Y') : (table[0].processLast = '')
      formList2.value[8].checked === true ? (table[0].outFlag = 'Y') : (table[0].outFlag = '')
      const res = (await SynchronizationLoginWork.put('/style/getStyleDetailUpdate', table[0])) as any
      if (res.code === 200) {
        JMessage.success('修改成功')
        getTableList()
      } else {
        JMessage.error(res.message)
      }
    })
    .catch(() => {
      ElMessage({
        type: 'info',
        message: '取消修改'
      })
      getTableList()
    })
}
onMounted(() => {
  getTableList(0)
})

// 表二模块
const tableHeader2 = ref([
  {
    label: '号码',
    prop: 'sizeNo',
    width: 50,
    change: true
  },
  {
    label: '订单数',
    prop: 'orderQty',
    width: 50,
    change: true
  },
  {
    label: '预补数',
    prop: 'surplusQty',
    width: 50
  }
])
const tableData2 = ref([])
const summaryData2 = ref<summaryDataType[]>([
  {
    index: 1,
    num: 0
  },
  {
    index: 2,
    num: 0
  }
])
const getTableList2 = async (lotNo: any = tableData.value[0] ? tableData.value[0].lotNo : '') => {
  const tableDataList = (await Synchronization.post('/style/getStyleSizeData', { lotNo })) as any
  tableData2.value = tableDataList.codeDetails.map((item: any) => {
    // item.change = 'Y'
    return item
  })
  if (tableDataList.codeDetailsSum) {
    summaryData2.value[0].num = tableDataList.codeDetailsSum.orderCount
    summaryData2.value[1].num = tableDataList.codeDetailsSum.surplusCount
  }
  if (tableData2.value.length === 0) {
    disabledValue2.value = false
  } else {
    disabledValue2.value = true
  }
}
// 修改指令明细（表二）
const confirmChange2 = async (row: any, fn: any) => {
  const res = (await SynchronizationLoginWork.post('/style/getStyleSizeDataUpdate', {
    ...row,
    lotNo: currentTableRow.value.lotNo
  })) as any
  if (res.code === 200) {
    JMessage.success('修改成功')
    getTableList2(currentTableRow.value.lotNo)
  } else {
    JMessage.error(res.message)
  }
}

// PO号码明细下拉框模块
const value = ref(0) // PO号码明细的v-model
const options = [
  {
    value: 0,
    label: 'PO号码明细'
  },
  {
    value: 1,
    label: '指令用量明细'
  },
  {
    value: 2,
    label: '配色注意事项'
  },
  {
    value: 3,
    label: '型体配楦明细'
  },
  {
    value: 4,
    label: '配色BOM资料'
  },
  {
    value: 5,
    label: '各节点明细'
  }
] // PO号码明细下拉框数组
const EndSelectVal = (val: any) => {
  getTableList999(val)
} // change事件
const getTableList999 = async (num: any = 0) => {
  let { lotNo, color, style, colorCode }: any = currentTableRow.value
  // PO号码明细
  if (num === 0) {
    getPoNumberDetails()
  }
  // 指令用量明细
  if (num === 1) {
    getUsageDetails()
  }
  // 配色注意事项
  if (num === 2) {
    const res = await Synchronization.post<any, any>('/Cargo/getNotesForFilingList', { styleColor: color, styleNo: colorCode })
    tableData6.value = res
  }
  // 型体配楦明细
  if (num === 3) {
    tableData7.value = await Synchronization.get<any, any>(`/style/getStyleToLastNoDetails?style=${currentTableRow.value.style}`)
  }
  // 配色BOM资料
  if (num === 4) {
    tableData8.value = await Synchronization.post<any, any>('/style/getColorBOMInfo', { color, style })
  }
  // 各节点生产明细
  if (num === 5) {
    getLastDetails()
    getProdDetails()
    getSoleDetails()
  }
}

// 美码/英码下拉框模块
const options2 = ref([]) as any // 美码/英码下拉框数组
// 美码/英码的disabled修改
const disabledValue2 = ref(true)

// JDialog模块
const JDialogHeader = ref([
  {
    label: 'PO',
    prop: 'poNo'
  },
  {
    label: '装箱方式',
    prop: 'caseType'
  }
]) as any
const clickAdd = async () => {
  let isCorrect = true as boolean
  JDialogHeader.value.splice(2, JDialogHeader.value.length)
  // 获取型体配楦接口
  const StyleToLast = await Synchronization.get<any, any>(`/style/getStyleToLastNoDetails?style=${currentTableRow.value.style}`)
  StyleToLast.forEach((item: any) => {
    if (!tableHeader4.value.find((item2: any) => item2.label === item.sizeNo + '#')) {
      isCorrect = false
      return
    }
    const prop = tableHeader4.value.find((item2: any) => item2.label === item.sizeNo + '#').prop
    JDialogHeader.value.push({
      label: item.sizeNo + '#',
      prop,
      type: 'number'
    })
  })
  if (isCorrect == false) JMessage.error('请选择正确的码制')
} // JDialog添加按钮点击函数

// PO号码明细表模块
const tableData4 = ref([]) as any
const tableHeader4 = ref([
  {
    label: '配码',
    prop: 'groupNo'
  },
  {
    label: 'PO',
    prop: 'poNo'
  },
  {
    label: '装箱方式',
    prop: 'caseType'
  },
  {
    label: '数量',
    prop: 'count'
  },
  {
    label: '码制',
    prop: 'sizeNotice'
  }
]) as any
// 获取PO号码明细表头
const currentPoNumberSizeData = ref([]) as any
const getPoNumberSizeData = async () => {
  await getPoNumberDetails()
  const res = await Synchronization.post<any, any>('/style/getPoNumberSizeData', {
    sizeCode: value2.value.split('  ')[1]
  })
  if (res) {
    currentPoNumberSizeData.value = res
    tableHeader4.value.splice(5, tableHeader4.value.length)
    res.forEach((item: any, index: number) => {
      tableHeader4.value.push({
        label: item.sizeNo,
        prop: 'qty' + (index + 1)
      })
    })
    // console.log(tableHeader4.value);
  }
}
const getPoNumberDetails = async () => {
  const res = (await Synchronization.post<any, any>('/style/getPoNumberDetails', { lotNo: currentTableRow.value.lotNo })) as any
  tableData4.value = res.pcLotGroups.map((item: any) => {
    if (currentTableRow.value.cfmFlag === 'Y') {
      item.change = 'Y'
    } else {
      item.change = false
    }
    return item
  })
  summaryData6.value[0].num = res.sum
  if (tableData4.value.length !== 0 && tableData4.value[0].sizeNotice) {
    value2.value = `${tableData4.value[0].sizeNotice}  ${tableData4.value[0].sizeCode}`
  }
  if (tableData4.value.length !== 0) currentRow4()
} // 获取PO号码明细表格
const confirmChange5 = async (row: any, fn: any) => {
  // const res = await SynchronizationLoginWork.post('/style/getPoNumberDetailAdd',{
  //   numberList,
  //   ...obj,
  //   lotNo: currentTableRow.value.lotNo,
  //   groupNo: Number(tableData4.value[tableData4.value.length - 1].groupNo) + 1
  // })
  // const res = await SynchronizationLoginWork.post('/style/getStyleSizeDataUpdate', {
  //   ...row,
  //   lotNo: currentTableRow.value.lotNo
  // }) as any
  // if (res.code === 200) {
  //   JMessage.success('修改成功')
  //   getTableList2(currentTableRow.value.lotNo)
  // } else {
  //   JMessage.error(res.message)
  // }
} // 修改PO号码明细表
const currentTable4Row = ref({}) as any
const currentTable4RowIndex = ref(0) as any
const currentRow4 = (row: any = tableData4.value[0]) => {
  currentTable4RowIndex.value = tableData4.value.findIndex((item: any) => item === row)
  currentTable4Row.value = row
}
const dialogConfirm = async (obj: any, dialogVisible: any) => {
  const numberList = [] as any
  const temObj = {
    qty1: 0,
    qty2: 0,
    qty3: 0,
    qty4: 0,
    qty5: 0,
    qty6: 0,
    qty7: 0,
    qty8: 0,
    qty9: 0,
    qty10: 0,
    qty11: 0,
    qty12: 0,
    qty13: 0,
    qty14: 0,
    qty15: 0,
    qty16: 0,
    qty17: 0,
    qty18: 0,
    qty19: 0,
    qty20: 0,
    qty21: 0,
    qty22: 0,
    qty23: 0,
    qty24: 0,
    qty25: 0,
    qty26: 0,
    qty27: 0,
    qty28: 0,
    qty29: 0,
    qty30: 0,
    qty31: 0,
    qty32: 0,
    qty33: 0,
    qty34: 0,
    qty35: 0,
    qty36: 0
  } as any
  // 计算表格每一列合计
  tableData4.value.forEach((item: any, index: number) => {
    for (const key in item) {
      for (const key2 in temObj) {
        if (key === key2) {
          temObj[key2] += item[key]
        }
      }
    }
  })
  // 表格合计和新增相加
  for (const key in obj) {
    for (const key2 in temObj) {
      if (key === key2) {
        temObj[key2] += Number(obj[key])
      }
    }
  }
  currentPoNumberSizeData.value.forEach((item: any, index: number) => {
    if (temObj['qty' + (index + 1)] !== 0) {
      numberList.push({
        seqNo: item.seqNo,
        sizeNo: item.sizeNo.slice(0, item.sizeNo.length - 1),
        orderQty: temObj['qty' + (index + 1)]
      })
    }
  })
  const res = (await SynchronizationLoginWork.post(`/style/getPoNumberDetailAdd`, {
    numberList,
    ...obj,
    lotNo: currentTableRow.value.lotNo,
    groupNo: tableData4.value.length === 0 ? 1 : Number(tableData4.value[tableData4.value.length - 1].groupNo) + 1,
    sizeCode: value2.value.split('  ')[1]
  })) as any
  if (res.code === 200) {
    JMessage.success('新增成功')
    dialogVisible.value = false
    getPoNumberDetails()
    getTableList2(currentTableRow.value.lotNo)
  } else {
    JMessage.error(res.message)
  }
} // PO号码明细表格增加
const removeOne = async () => {
  ElMessageBox.confirm('是否删除该条数据?', 'Warning', {
    confirmButtonText: '确认',
    cancelButtonText: '取消',
    type: 'warning'
  })
    .then(async () => {
      let isOne = true
      if (tableData4.value.length > 1) isOne = false
      let res = {} as any
      const numberList = [] as any
      const temObj = {
        qty1: 0,
        qty2: 0,
        qty3: 0,
        qty4: 0,
        qty5: 0,
        qty6: 0,
        qty7: 0,
        qty8: 0,
        qty9: 0,
        qty10: 0,
        qty11: 0,
        qty12: 0,
        qty13: 0,
        qty14: 0,
        qty15: 0,
        qty16: 0,
        qty17: 0,
        qty18: 0,
        qty19: 0,
        qty20: 0,
        qty21: 0,
        qty22: 0,
        qty23: 0,
        qty24: 0,
        qty25: 0,
        qty26: 0,
        qty27: 0,
        qty28: 0,
        qty29: 0,
        qty30: 0,
        qty31: 0,
        qty32: 0,
        qty33: 0,
        qty34: 0,
        qty35: 0,
        qty36: 0
      } as any
      // 计算表格每一列合计
      if (!isOne) tableData4.value.splice(currentTable4RowIndex.value, 1)
      tableData4.value.forEach((item: any, index: number) => {
        for (const key in item) {
          for (const key2 in temObj) {
            if (key === key2) {
              temObj[key2] += item[key]
            }
          }
        }
      })
      currentPoNumberSizeData.value.forEach((item: any, index: number) => {
        if (temObj['qty' + (index + 1)] !== 0) {
          numberList.push({
            seqNo: item.seqNo,
            sizeNo: item.sizeNo.slice(0, item.sizeNo.length - 1),
            orderQty: temObj['qty' + (index + 1)]
          })
        }
      })
      if (!isOne) {
        console.log(11111111)
        res = (await SynchronizationLoginWork.post(`/style/getPoNumberDetailDel`, {
          ...currentTable4Row.value,
          numberList,
          lotNo: currentTableRow.value.lotNo
        })) as any
      } else {
        console.log(222222222)
        res = (await SynchronizationLoginWork.post(`/style/getPoNumberDetailDel`, {
          ...currentTable4Row.value,
          numberList: numberList.map((item: any) => {
            item.orderQty = 0
            return item
          }),
          lotNo: currentTableRow.value.lotNo
        })) as any
      }
      console.log(numberList)

      if (res.code === 200) {
        JMessage.success('删除成功')
        getPoNumberDetails()
        getTableList2(currentTableRow.value.lotNo)
      } else {
        JMessage.error(res.message)
        currentRow()
      }
    })
    .catch(() => {
      ElMessage({
        type: 'info',
        message: '取消删除'
      })
    })
} // PO号码明细表格删除

// 指令用量明细表模块
const tableHeader5 = ref([
  {
    label: '序号',
    prop: 'seqNo',
    width: 50
  },
  {
    label: '部位',
    prop: 'partName'
  },
  {
    label: '物料编号',
    prop: 'mtlNo',
    width: 120
  },
  {
    label: '段',
    prop: 'segment',
    width: 50
  },
  {
    label: '分类',
    prop: 'mtlTypeNo'
  },
  {
    label: '分类名称',
    prop: 'typeName'
  },
  {
    label: '材料颜色',
    prop: 'mtlColor'
  },
  {
    label: '材料名称',
    prop: 'mtlName',
    width: 200
  },
  {
    label: '规格',
    prop: 'mtlSpec'
  },
  {
    label: '单位',
    prop: 'mtlUnit'
  },
  {
    label: '尺码起',
    prop: 'size1'
  },
  {
    label: '尺码止',
    prop: 'size2'
  },
  {
    label: '单耗',
    prop: 'stdUsage'
  },
  {
    label: '用量',
    prop: 'ttlUsage'
  },
  {
    label: '预加量',
    prop: 'addUsage'
  },
  {
    label: '比例%',
    prop: 'proportion'
  },
  {
    label: '备注',
    prop: 'remark'
  }
])
const tableData5 = ref([])
const getUsageDetails = async () => {
  const res = (await Synchronization.post<any, any>('/style/getUsageDetails', { lotNo: currentTableRow.value.lotNo })) as any
  tableData5.value = res
} // 获取指令用量明细

// 配色注意事项表模块
const tableHeader6 = ref([
  {
    label: '序号',
    prop: 'seqNo',
    width: 50
  },
  {
    label: '事项名称',
    prop: 'prodMemo'
  },
  {
    label: '生产注意事项',
    prop: 'seqName',
    width: 150
  }
])
const tableData6 = ref([])

// 型体配楦明细表模块
const tableHeader7 = ref([
  {
    label: '鞋码',
    prop: 'sizeNo'
  },
  {
    label: '冲刀',
    prop: 'cutSize'
  },
  {
    label: '楦头',
    prop: 'lastSize'
  },
  {
    label: '大底',
    prop: 'soleSize'
  },
  {
    label: '中底',
    prop: 'insoleSize'
  }
])
const tableData7 = ref([])

// 配色BOM资料模块
const tableHeader8 = ref([
  {
    label: '序号',
    prop: 'seqNo',
    width: 50
  },
  {
    label: '部位',
    prop: 'partName',
    width: 150
  },
  {
    label: '分段',
    prop: 'segment',
    width: 50
  },
  {
    label: '片数',
    prop: 'meiyou',
    width: 50
  },
  {
    label: '分类名称',
    prop: 'typeName'
  },
  {
    label: '物料编码',
    prop: 'mtlNo',
    width: 150
  },
  {
    label: '材料颜色',
    prop: 'mtlColor'
  },
  {
    label: '材料名称',
    prop: 'mtlName',
    width: 300
  },
  {
    label: '规格',
    prop: 'mtlSpec'
  },
  {
    label: '单位',
    prop: 'mtlUnit',
    width: 50
  },
  {
    label: '尺码起',
    prop: 'size1'
  },
  {
    label: '尺码止',
    prop: 'size2'
  },
  {
    label: '用量',
    prop: 'usage'
  },
  {
    label: '计算方式',
    prop: 'usageType'
  },
  {
    label: '领用部门',
    prop: 'drawDept'
  },
  {
    label: '捡料',
    prop: 'noLotUsage'
  },
  {
    label: '主辅料',
    prop: 'mtlProperty'
  }
])
const tableData8 = ref([])

// 各节点生产明细模块
const tableHeader9 = ref([
  {
    label: '号码',
    prop: 'sizeNo',
    width: 80
  },
  {
    label: '订单数',
    prop: 'orderQty',
    width: 80
  },
  {
    label: '预补数',
    prop: 'surplusQty',
    width: 80
  }
])
const tableData9 = ref([])
const tableHeader10 = ref([
  {
    label: '号码',
    prop: 'sizeNo',
    width: 80
  },
  {
    label: '订单数',
    prop: 'orderQty',
    width: 80
  },
  {
    label: '预补数',
    prop: 'surplusQty',
    width: 80
  }
])
const tableData10 = ref([])
const tableHeader11 = ref([
  {
    label: '号码',
    prop: 'sizeNo',
    width: 80
  },
  {
    label: '订单数',
    prop: 'orderQty',
    width: 80
  },
  {
    label: '预补数',
    prop: 'surplusQty',
    width: 80
  }
])
const tableData11 = ref([])
const summaryData3 = ref<summaryDataType[]>([
  {
    index: 1,
    num: 0
  },
  {
    index: 2,
    num: 0
  }
])
const summaryData4 = ref<summaryDataType[]>([
  {
    index: 1,
    num: 0
  },
  {
    index: 2,
    num: 0
  }
])
const summaryData5 = ref<summaryDataType[]>([
  {
    index: 1,
    num: 0
  },
  {
    index: 2,
    num: 0
  }
])
const summaryData6 = ref<summaryDataType[]>([
  {
    index: 3,
    num: 0
  }
])
// 获取表格数据
const getLastDetails = async () => {
  const res = await Synchronization.post<any, any>('/style/getLastDetails', { lotNo: currentTableRow.value.lotNo })
  tableData11.value = res.codeDetails
  summaryData5.value[0].num = res.codeDetailsSum.orderCount
  summaryData5.value[1].num = res.codeDetailsSum.surplusCount
} // 取成型生产号码明细查询
const getProdDetails = async () => {
  const res = await Synchronization.post<any, any>('/style/getStitchDetails', { lotNo: currentTableRow.value.lotNo })
  tableData10.value = res.codeDetails
  summaryData4.value[0].num = res.codeDetailsSum.orderCount
  summaryData4.value[1].num = res.codeDetailsSum.surplusCount
} // 取鞋面生产号码明细查询
const getLastDetailsAdd = async () => {
  const res = (await SynchronizationLoginWork.post('/style/getLastDetailsAdd', {
    lotNo: currentTableRow.value.lotNo
  })) as any
  if (res.code === 200) {
    JMessage.success('取成型生产号码明细成功')
    getLastDetails()
  } else {
    JMessage.error(res.message)
  }
} // 取成型生产号码明细按钮点击事件
const getStitchDetailsAdd = async () => {
  const res = (await SynchronizationLoginWork.post('/style/getStitchDetailsAdd', {
    lotNo: currentTableRow.value.lotNo
  })) as any
  if (res.code === 200) {
    JMessage.success('取鞋面生产号码明细成功')
    getProdDetails()
  } else {
    JMessage.error(res.message)
  }
} // 取鞋面生产号码明细按钮点击事件
const getSoleDetails = async () => {
  const res = await Synchronization.post<any, any>('/style/getSoleDetails', { lotNo: currentTableRow.value.lotNo })
  tableData9.value = res.codeDetails
  summaryData3.value[0].num = res.codeDetailsSum.orderCount
  summaryData3.value[1].num = res.codeDetailsSum.surplusCount
} // 取大底入货号码明细查询
const getSoleDetailsAdd = async () => {
  const res = (await SynchronizationLoginWork.post('/style/getSoleDetailsAdd', {
    lotNo: currentTableRow.value.lotNo
  })) as any
  if (res.code === 200) {
    JMessage.success('取大底入货号码明细成功')
    getSoleDetails()
  } else {
    JMessage.error(res.message)
  }
} // 取大底入货号码明细按钮点击事件

// 获取下拉框数据
const selectList = async () => {
  let res = await Synchronization.get<any, any>('/style/getCondition')
  // 底膜
  res.moldNo.forEach((item: any) => {
    if (item === null || item === '') return
    formList.value
      .find((item: any) => item.type === 'select' && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '底模')
      .selectOptions.push({
        optionValue: item,
        optionLabel: item
      })
  })
  // lastNo 楦头
  res.lastNo.forEach((item: any) => {
    if (item === null || item === '') return
    formList.value
      .find((item: any) => item.type === 'select' && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '楦头')
      .selectOptions.push({
        optionValue: item,
        optionLabel: item
      })
  })

  // custom  品牌
  res.custom.forEach((item: any) => {
    if (item === null || item === '') return
    formList.value
      .find((item: any) => item.type === 'select' && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '品牌')
      .selectOptions.push({
        optionValue: item,
        optionLabel: item
      })
  })

  // cutNo 冲刀
  res.cutNo.forEach((item: any) => {
    if (item === null || item === '') return
    formList.value
      .find((item: any) => item.type === 'select' && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '冲刀')
      .selectOptions.push({
        optionValue: item,
        optionLabel: item
      })
  })
  // season 季度
  res.season.forEach((item: any) => {
    if (item === null || item === '') return
    formList.value
      .find((item: any) => item.type === 'select' && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '季度')
      .selectOptions.push({
        optionValue: item,
        optionLabel: item
      })
  })
  // soleVendor 大底厂商
  res.soleVendor.forEach((item: any) => {
    if (item === null || item === '') return
    formList.value
      .find((item: any) => item.type === 'select' && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '大底厂商')
      .selectOptions.push({
        optionValue: item,
        optionLabel: item
      })
  })

  const res2 = (await Synchronization.get('/back/getSizeTypeByName')) as any
  options2.value = res2.map((item: any) => {
    return {
      label: item.sizeNotice,
      value: `${item.sizeNotice}  ${item.sizeCode}`
    }
  })
}
onMounted(() => {
  selectList()
})
</script>

<style lang="less" scoped>
:deep(.cell:hover) {
  background-color: white !important;
  cursor: pointer;
}

:deep(.el-input__suffix) {
  display: none;
}

:deep(.el-form-item:nth-child(2)) {
  .el-input {
    width: 250px;
  }
}

.AC {
  align-items: center;
}
</style>
